package com.cy.util;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.serializer.RedisSerializer;

import java.io.Serializable;

/**
 * Created by Administrator on 2017/7/15.
 */
public abstract class RedisGeneratorUtil<K extends Serializable, V extends Serializable> {

    private final Logger logger = LoggerFactory.getLogger(RedisGeneratorUtil.class);
    @Autowired
    public RedisTemplate<K,V> redisTemplate ;


    public void setRedisTemplate(RedisTemplate<K, V> redisTemplate) {
        this.redisTemplate = redisTemplate;
    }

    public RedisSerializer<String> getRedisSerializer() {
        return redisTemplate.getStringSerializer();
    }

}
